package com.design_mode;

/**
 * Created by dustaple on 8/4/14.
 */
public class BridgePattern {
    public static void main(String[] args) {

        People meinv = new Meinv();
        People dahan = new Junzi();

        meinv.setPlace(new Jiangnan());
        dahan.setPlace(new Dongbei());

        meinv.charactor();
        dahan.charactor();

    }
}

abstract class People {
    private Place place;

    public abstract void face();

    public abstract void name();

    void charactor() {
        place.peopleCharactior();
        name();
        face();
    }

    public Place getPlace() {
        return place;
    }

    public void setPlace(Place place) {
        this.place = place;
    }
}

class Meinv extends People {
    @Override
    public void face() {
        System.out.println("雪白的肌肤，弯弯的眉毛，水汪汪的眼睛，樱桃嘴。");
    }

    @Override
    public void name() {
        System.out.println("美女");
    }

    @Override
    void charactor() {
        super.charactor();
    }
}

class Junzi extends People {
    @Override
    public void face() {
        System.out.println("健强的体魄，四方大脸，剑眉星目，正气凌然。");
    }

    @Override
    public void name() {
        System.out.println("壮汉");
    }

    @Override
    void charactor() {
        super.charactor();
    }
}

interface Place{
    void peopleCharactior();
}
class Dongbei implements Place{
    @Override
    public void peopleCharactior() {
        System.out.println("东北多大汉.");
    }
}
class Jiangnan implements Place{
    @Override
    public void peopleCharactior() {
        System.out.println("江南多美女.");
    }
}